package com.cy.mall.service.customer;

import java.util.List;
import java.util.Map;

import com.cy.mall.model.PageBean;
import com.cy.mall.model.Result;
import com.cy.mall.model.ao.customer.CustomerContactInfoSaveAO;
import com.cy.mall.model.ao.customer.CustomerHouseInfoSaveAO;
import com.cy.mall.model.ao.customer.CustomerImageAddAO;
import com.cy.mall.model.ao.customer.CustomerLoginAO;
import com.cy.mall.model.domain.customer.Customer;
import com.cy.mall.model.domain.customer.CustomerBank;
import com.cy.mall.model.domain.customer.CustomerIdCardAuthRecord;
import com.cy.mall.model.dto.customer.IdCardOcrResultSaveDTO;
import com.cy.mall.model.dto.customer.ValidateBigDataResultDTO;
import com.cy.mall.model.dto.customer.ValidateFaceIdResultDTO;
import com.cy.mall.model.dto.fujue.req.AuthDataDTO;
import com.cy.mall.model.dto.fujue.resp.AuthStatusRespDTO;
import com.cy.mall.model.dto.xiaoan.XiaoanCreditCheckRecordNotifyDTO;
import com.cy.mall.model.dto.xiaoan.XiaoanNotifyResult;
import com.cy.mall.model.enums.customer.CustomerIdCardAuthStatus;
import com.cy.mall.model.query.customer.CustomerInviteListQuery;
import com.cy.mall.model.vo.customer.*;

/**
 * 客户模块服务
 *
 * @author tanyilin
 *
 * @create 2019年2月25日 下午3:39:16
 */
public interface CustomerService {

	/**
	 * 客户登录
	 * 
	 * @param loginAO
	 * @return
	 */
	Result login(CustomerLoginAO loginAO);

	/**
	 * 更新客户进行faceid人脸识别的bizToken
	 * 
	 * @param customerId
	 * @param bizToken
	 */
	void updateBizToken(Long customerId, String bizToken);

	/**
	 * 保存人脸识别check的结果
	 * 
	 * @param textMap
	 * @param bizToken
	 */
	void saveFaceIdCheckResult(Map<String, Object> textMap, String bizToken);
	
	/**
	 * 验证客户是否已完成人脸识别
	 * 
	 * @param customerId
	 * @return
	 */
	ValidateFaceIdResultDTO validateFaceIdResult(Long customerId);
	
	/**
	 * 查询客户大数据查询结果
	 * 
	 * @param customerId
	 * @return
	 */
	ValidateBigDataResultDTO validateBigDataResult(Long customerId);
	
	/**
	 * 通过主键ID，查询客户信息
	 * 
	 * @param customerId
	 * @return
	 */
	Customer selectCustomerByPrimaryKey(Long customerId);
	
	/**
	 * 更新Customer信息
	 * 
	 * @param customer
	 */
	void updateCustomer(Customer customer);
	
	/**
	 * 根据风控规则判断客户大数据是否通过，并更新客户大数据查询结果信息表
	 * 
	 * @param dataMap
	 * @param customerId
	 * @return
	 */
	Result judgeBigDataCheckResult(Map<String, Object> dataMap, Long customerId);

	/**
	 * 处理小安蓝精灵客户信用评估回调结果
	 * 
	 * @param notifyDTO
	 * @return
	 */
	XiaoanNotifyResult handleXiaoanCreditCheckNotify(XiaoanCreditCheckRecordNotifyDTO notifyDTO);

	/**
	 * 前台-客户-我的页面信息
	 * @param customerId
	 * @return com.cy.mall.model.vo.customer.CustomerMyInfoVO
	 */
    CustomerMyInfoVO selectCustomerMyInfoVO(Long customerId);

    /**
     * 前台-客户-我的邀请客户人数列表
     * @param query
     * @return com.cy.mall.model.PageBean<com.cy.mall.model.vo.customer.CustomerInviteListVO>
     */
	PageBean<CustomerInviteListVO> selectCustomerInviteList(CustomerInviteListQuery query);

	/**
	 * 查询客户已上传并ocr识别出来的身份证信息
	 * @param customerId
	 * @return com.cy.mall.model.vo.customer.CustomerIdCardInfoVO
	 */
	CustomerIdCardInfoVO getCustomerIdCardInfo(Long customerId);

	/**
	 * 验证用户是否已完成实名实人验证
	 * @param customerId
	 * @return com.cy.mall.model.Result
	 */
	Result validateIdCardResult(Long customerId);

	/**
	 * 保存身份证ocr认证结果
	 * @param idCardOcrResultSaveDTO
	 * @param imageAddAO
	 * @param customerId
	 * @return void
	 */
    void doSaveIdCardOcrResult(IdCardOcrResultSaveDTO idCardOcrResultSaveDTO, CustomerImageAddAO imageAddAO, Long customerId);

    /**
     * 查询客户实名认证数据
     * @param customerId
     * @return com.cy.mall.model.dto.fujue.req.AuthDataDTO
     */
	AuthDataDTO getCustomerAuthDataDTO(Long customerId);

	/**
	 * 查询客户身份证认证记录
	 * @param customerId
	 * @return com.cy.mall.model.domain.customer.CustomerIdCardAuthRecord
	 */
	CustomerIdCardAuthRecord getCustomerIdCardAuthRecord(Long customerId);

	/**
	 * 更新人脸识别状态
	 * @param authStatusRespDTO
	 * @param customerIdCardAuthRecord
	 * @return void
	 */
    void doUpdateCustomerAuthStatus(AuthStatusRespDTO authStatusRespDTO, CustomerIdCardAuthRecord customerIdCardAuthRecord);

    /**
     * 查询客户的申请信息填写状态
     * @param customerId
     * @return com.cy.mall.model.vo.customer.CustomerApplyInfoStatusVO
     */
	CustomerApplyInfoStatusVO queryCustomerApplyInfoStatus(Long customerId);

	/**
	 * 查询客户房屋信息详情
	 * @param customerId
	 * @return com.cy.mall.model.vo.customer.CustomerHouseInfoDetailVO
	 */
	CustomerHouseInfoDetailVO getCustomerHouseInfoDetail(Long customerId);

	/**
	 * 保存客户房屋信息
	 * @param saveAO
	 * @param customerId
	 * @return void
	 */
	void doSaveCustomerHouseInfo(CustomerHouseInfoSaveAO saveAO, Long customerId);

	/**
	 * 获取客户联系人信息
	 * @param customerId
	 * @return java.util.List<com.cy.mall.model.vo.customer.CustomerContactInfoVO>
	 */
	List<CustomerContactInfoVO> getCustomerContactInfo(Long customerId);

	/**
	 * 保存客户联系人信息
	 * @param saveAO
	 * @param customerId
	 * @return void
	 */
	void doSaveCustomerContactInfo(CustomerContactInfoSaveAO saveAO, Long customerId);

	/**
	 * 更新人脸识别实名认证状态
	 * @param customerId
	 * @param authStatus
	 * @return void
	 */
	void updateCustomerIdCardAuthStatus(Long customerId, CustomerIdCardAuthStatus authStatus);

	/**
	 * 获取我的银行卡列表
	 * @param customerId
	 * @return java.util.List<com.cy.mall.model.domain.customer.CustomerBank>
	 */
    List<CustomerBank> getBankList(Long customerId);

    /**
     * 清除客户实名认证记录
     * @param mobile
     * @return void
     */
    void deleteCustomerAuthRecord(String mobile);
}
